package com.dzm.xgb.core.controller.api;

import com.dzm.common.result.R;
import com.dzm.xgb.core.pojo.entity.Dict;
import com.dzm.xgb.core.service.DictService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者：Dzm
 * 时间：024-09-19-11:10
 * 功能：
 */

@Api(tags = "字典管理")
@RestController
@RequestMapping("/api/core/dict")
public class DictController {

    @Autowired
    private DictService dictService;

    @GetMapping("/getDictByCode/{dictCode}")
    public R findByDictCode(@PathVariable("dictCode") String  dictCode) {
        List<Dict> dictList = dictService.findByDictCode(dictCode);

        return R.ok().data("dictList", dictList);
    }
}
